<?php
//echo $_REQUEST['acts'];exit;
define("IN_ECS", true);
require_once(dirname(dirname(__FILE__)).'/includes/init.php');
require_once (dirname(dirname(__FILE__)).'/baseclass/cls_createHB.php');
require_once (dirname(dirname(__FILE__)).'/baseclass/cls_createDH.php');
require_once (dirname(dirname(__FILE__)).'/baseclass/cls_createcode.php');
class bonus{
    
    //获取活动信息
    public static function get_bonus_act($actid){
        $sql = "select * from tage_wx_bonus_act where id=".$actid;
        return $GLOBALS['db']->getRow($sql);
    }
    
    //根据红包id获取原始红包信息
    public static function get_bonus_primary_byId($actid,$id){
        $sql  = "select * from tage_wx_bonus_primary where bonus_actid=".$actid." and id=".$id;
        return $GLOBALS['db']->getRow($sql);
    }
    
     //根据openid获取原始红包信息
    public static function get_bonus_primary_byOpenid($actid,$openid){
        $sql  = "select * from tage_wx_bonus_primary where bonus_actid=".$actid." and openid='".$openid."'";
        return $GLOBALS['db']->getRow($sql);
    }
    
    //获取红包信息
    public static function get_bonus_account($actid,$openid){
        $sql = "select * from tage_wx_bonus_account where actid=".$actid." and openid='".$openid."'";
        return $GLOBALS['db']->getRow($sql);
    }
}
    
    
    
    
    


